﻿using System.Data;
using PolePositionMobileUtilityGeneral;

namespace PolePositionMobileUtilityEntity.Entities
{
    public class EVisitType : ELookup
    {
        public EVisitType()
        {
            m_TableColumnType = "VisitTypes";
        }

        public EVisitType(int id, string name) : this()
        {
            Id = id;
            Name = name;
        }

        public EVisitType[] GetAll()
        {
            DataTable _dt = SelectAll();
            EVisitType[] _visitTypes = new EVisitType[_dt.Rows.Count];
            for (int i = 0; i < _dt.Rows.Count; i++)
            {
                _visitTypes[i] = new EVisitType(ConvertMobileHelper.ToInt32(_dt.Rows[i][m_TableCollumnId]), ConvertMobileHelper.Tostring(_dt.Rows[i][m_TableCollumnName]));
            }

            return _visitTypes;
        }
    }
}
